class Solution:
    def maxArea(self, height: List[int]) -> int:
        n = len(height)

        l,r = 0,n-1
        res = -1
        while l < r:
            res = max(res, min(height[l],height[r]) * (r-l))

            if height[l] > height[r]:
                r-=1
            else:
                l+=1
            
        return res